﻿<!DOCTYPE html>
<html class="um landscape min-width-240px min-width-320px min-width-480px min-width-768px min-width-1024px">
<head>
    <title></title>
    <meta charset="utf-8">
    <meta name="viewport" content="target-densitydpi=device-dpi,width=device-width, initial-scale=1, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
    <link rel="stylesheet" href="/ZhongLangWxApp/CSSJS/APPCAN/css/fonts/font-awesome.min.css">
    <link rel="stylesheet" href="/ZhongLangWxApp/CSSJS/APPCAN/css/ui-box.css">
    <link rel="stylesheet" href="/ZhongLangWxApp/CSSJS/APPCAN/css/ui-base.css">
    <link rel="stylesheet" href="/ZhongLangWxApp/CSSJS/APPCAN/css/ui-color.css">
    <link rel="stylesheet" href="/ZhongLangWxApp/CSSJS/APPCAN/css/appcan.icon.css">
    <link rel="stylesheet" href="/ZhongLangWxApp/CSSJS/APPCAN/css/appcan.control.css">
</head>
<body class="um-vp bc-bg" ontouchstart onload="pageInit();">
    <!--------------------------------------->
    <div id="header" class="uh bc-text-head ub bc-head head-p ub-ac">
        <img id="divBack" src="/ZhonglangWxApp/CSSJS/APPCAN/css/icons/icon-back.png" height="32" style="margin-left: 0.5em" />
        <div class="ut ub-f1 ulev1 ut-s tx-c">测试</div>
        <div class="ub " style="width:2em;font-weight: 900;"></div>
    </div>
    <!------------------------------------>     
    <div class="ub uinn ub-ver uinn-a1">
        <div class="ub ub-ver" style="padding-top: 2em;">           
            <div class="uinn-at1">
                <div class="btn ub ub-ac bc-text-head ub-pc bc-btn uc-a1 ulev1" id="btnTestOne">测试查询</div>
                <div class="btn ub ub-ac bc-text-head ub-pc bc-btn uc-a1 ulev1" id="btnTestMore">测试多条</div>
                <div class="btn ub ub-ac bc-text-head ub-pc bc-btn uc-a1 ulev1" id="btnTestExec">测试执行</div>
                <textarea id="txtPrame" rows="6" style="width:100%"></textarea>
            </div> 
        </div>
    </div>
    <!--------------------------------------------->   
    <script src="/ZhongLangWxApp/WEB/jquery-3.3.1.min.js"></script>
    <script src="/ZhongLangWxApp/WEB/ZLJS_DB.js"></script> 
    <script> 
    function pageInit() {  
        $("#btnTestOne").click(function ()  { funTestOne(); });
        $("#btnTestMore").click(function () { funTestMore(); });
        $("#btnTestExec").click(function () { funTestExec(); }); 
    }
    function funTestOne() {
        var SDList = new Array();
        SDList[0] = "TEST:" + "$中文……^";
        var vPRAME = WEBDB_PRAME("PROZL_TESTDBONE", SDList, ZHONGLANGDB_CONN); $("#txtPrame").val(vPRAME);
        var vBACK = getZhongLangDB_O(SDList, "PROZL_TESTDBONE", ZHONGLANGDB_CONN);
        alert(vBACK);
    }
    function funTestMore() {
        var SDList = new Array();
        SDList[0] = "TEST1:" + "$中文1……^";
        SDList[1] = "TEST2:" + "$中文2……^";
        var vBACK = getZhongLangDB_Q(SDList, "PROZL_TESTDBMORE", ZHONGLANGDB_CONN);
        if (vBACK.length > 0) {
            alert(vBACK.length.toString() + ":" + vBACK[0].ROWALL + " TT:" + vBACK[0].TT);
        }
    }
    function funTestExec() {
        var SDList = new Array();
        SDList[0] = "TEST1:" + "$中文1……^";
        SDList[1] = "TEST2:" + "$中文2……^";
        var vBACK = getZhongLangDB_E(SDList, "PROZL_TESTDBEXEC", ZHONGLANGDB_CONN);
        alert(vBACK);
    }

        /* 在数据库中建存储过程来测试
CREATE PROC [dbo].[PROZL_TESTDBONE](
  @_TEST VARCHAR(32)  
) AS BEGIN
  SELECT 'BACK:' + ISNULL(@_TEST,'NULL') TT; 
END; 


CREATE PROC [dbo].[PROZL_TESTDBMORE](
  @_TEST1 VARCHAR(32),@_TEST2 VARCHAR(32) 
) AS BEGIN
  SELECT *  FROM (
	  SELECT 1 KEYID, @_TEST1 TT UNION ALL 
	  SELECT 2 KEYID, @_TEST2 TT) TT; 
END;  


CREATE PROC [dbo].[PROZL_TESTDBEXEC](
  @_TEST1 VARCHAR(32),@_TEST2 VARCHAR(32),@_STRBACK VARCHAR(252) OUT  
) AS BEGIN 
------------------ 
	IF @_TEST2 IS NULL  BEGIN SET @_STRBACK = '数据参数传递有误！';  END;
    DECLARE @_KEYID BIGINT; EXEC PROTT_PUB_GETKEYID @_KEYID OUT; 	
    
    SET @_STRBACK = 'OK'+CONVERT(VARCHAR(32),@_KEYID);
------------------  
END

--表中ID类型为用BIGINT  
--普通类业务表中固定增加字段 UPDATEMANID BIGINT,UPDATEMANNAME VARCHAR(32),UPDATETIME DATETIME  
--审核类业务表可不需要  
CREATE PROC [dbo].[PROTT_PUB_GETKEYID](
	@IBACK BIGINT OUT
) AS BEGIN
	-- DECLARE @TT BIGINT; EXEC PROTT_PUB_GETKEYID @TT OUT;SELECT @TT;	
	DECLARE @CURR VARCHAR(22);
	SET @CURR = CONVERT(VARCHAR(19),GETDATE(),120);
	SET @CURR = SUBSTRING(@CURR,3,2)+SUBSTRING(@CURR,6,2)+SUBSTRING(@CURR,9,2)+SUBSTRING(@CURR,12,2)+SUBSTRING(@CURR,15,2)+SUBSTRING(@CURR,18,2)
				+CONVERT(VARCHAR(4),1000+DATEPART(MS,GETDATE()) )
				+CONVERT(VARCHAR(3),100+CAST(FLOOR(RAND()*100) AS INT)) 
	SET @IBACK = CONVERT(BIGINT,@CURR);  	 
END;
        
        */

    </script> 
</body> 
</html>